//
//  BaseViewController.m
//  海角音乐
//
//  Created by dllo on 15/8/4.
//  Copyright (c) 2015年 杨元石. All rights reserved.
//

#import "BaseViewController.h"

@interface BaseViewController ()

@end

@implementation BaseViewController

- (void)dealloc
{
    [_recommedModel release];
    [super dealloc];
}




- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    // 背景图片
    UIImageView *back_image = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
    back_image.image = [UIImage imageNamed:@"素材落日"];
    [back_image setContentScaleFactor:[[UIScreen mainScreen] scale]];
    back_image.contentMode =  UIViewContentModeScaleAspectFill;
    back_image.autoresizingMask = UIViewAutoresizingFlexibleHeight;
    back_image.clipsToBounds  = YES;
    [self.view addSubview:back_image];
    
    [back_image release];
    self.view.backgroundColor = [UIColor whiteColor];
    [self setAutomaticallyAdjustsScrollViewInsets:NO];
    
    // 通知什么不知道
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(nightMode:) name:@"NIGHTMODE" object:nil];
    
    // 重要的左键返回方法
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"fanhui_32.png"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] style:UIBarButtonItemStyleDone target:self action:@selector(LeftBack)];
    
    
    // Do any additional setup after loading the view.
}
// POP 方法
- (void)LeftBack
{

    [self.navigationController popViewControllerAnimated:YES];
    
}

- (void)nightMode:(NSNotification *)center
{
   
    self.view.backgroundColor = [UIColor brownColor];
    
    
}

-(UIStatusBarStyle)preferredStatusBarStyle
{
    return UIStatusBarStyleLightContent;
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
